package com.myjar.excel.v2;

import org.apache.poi.ss.usermodel.Sheet;

public class POiSheet implements _Sheet {

    private Sheet sheet;

    public POiSheet(Sheet sheet) {
        this.sheet = sheet;
    }

    @Override
    public _Row getRow(int index) {
        return new POiRow(sheet.getRow(index));
    }

    @Override
    public _Row createRow(int index) {
        return new POiRow(sheet.createRow(index));
    }

    @Override
    public int rowSize() {
        return isNull() ? 0 : sheet.getPhysicalNumberOfRows();
    }


    @Override
    public boolean isNull() {
        return sheet == null;
    }
}
